package com.isoft.c2team3service2.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isoft.c2team3service2.entity.UserMessageStatus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMessageStatusMapper extends BaseMapper<UserMessageStatus> {
    // 批量更新消息为已读
    @Update("UPDATE user_message_status SET is_read = 1 WHERE receiver_id = #{receiverId} AND message_id IN #{messageIds}")
    int batchMarkAsRead(Integer receiverId, List<Integer> messageIds);
}